Optimal. Leaf size=603 \[ -\frac{\sqrt{a+b x+c x^2} \left (h x \left (h^2 \left (8 a^2 f h^2-2 a b h (10 f g-e h)+b^2 \left (11 f g^2-h (d h+e g)\right )\right )+2 c g h \left (2 a h (6 f g-e h)-b \left (12 f g^2-h (2 d h+e g)\right )\right )+4 c^2 \left (3 f g^4-d g^2 h^2\right )\right )+h^2 \left (4 a^2 e h^3-2 a b h \left (d h^2+2 e g h+3 f g^2\right )+b^2 g \left (d h^2+e g h+5 f g^2\right )\right )-2 c g h \left (-2 a d h^3-6 a f g^2 h+b d g h^2+7 b f g^3\right )+8 c^2 f g^5\right )}{8 h^3 (g+h x)^2 \left (a h^2-b g h+c g^2\right )^2}-\frac{\tanh ^{-1}\left (\frac{-2 a h+x (2 c g-b h)+b g}{2 \sqrt{a+b x+c x^2} \sqrt{a h^2-b g h+c g^2}}\right ) \left (2 c h^2 \left (4 a^2 h^2 (4 f g-e h)-2 a b h \left (-d h^2-e g h+15 f g^2\right )+b^2 \left (d g h^2+15 f g^3\right )\right )-b h^3 \left (8 a^2 f h^2-2 a b h (e h+6 f g)+b^2 \left (d h^2+e g h+5 f g^2\right )\right )-8 c^2 g h \left (a d h^3-5 a f g^2 h+5 b f g^3\right )+16 c^3 f g^5\right )}{16 h^4 \left (a h^2-b g h+c g^2\right )^{5/2}}-\frac{\left (a+b x+c x^2\right )^{3/2} \left (f g^2-h (e g-d h)\right )}{3 h (g+h x)^3 \left (a h^2-b g h+c g^2\right )}+\frac{\sqrt{c} f \tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+b x+c x^2}}\right )}{h^4} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 1.44877, antiderivative size = 601, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 32, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.188, Rules used = {1650, 810, 843, 621, 206, 724} \[ -\frac{\sqrt{a+b x+c x^2} \left (h x \left (8 a^2 f h^3-2 b \left (a h^2 (10 f g-e h)-c g h (2 d h+e g)+12 c f g^3\right )+4 a c g h (6 f g-e h)+b^2 h \left (11 f g^2-h (d h+e g)\right )+c^2 \left (\frac{12 f g^4}{h}-4 d g^2 h\right )\right )+4 a^2 e h^4-2 b \left (a h^2 \left (d h^2+2 e g h+3 f g^2\right )+c \left (d g^2 h^2+7 f g^4\right )\right )+4 a c g h \left (d h^2+3 f g^2\right )+b^2 g h \left (h (d h+e g)+5 f g^2\right )+\frac{8 c^2 f g^5}{h}\right )}{8 h^2 (g+h x)^2 \left (a h^2-b g h+c g^2\right )^2}-\frac{\tanh ^{-1}\left (\frac{-2 a h+x (2 c g-b h)+b g}{2 \sqrt{a+b x+c x^2} \sqrt{a h^2-b g h+c g^2}}\right ) \left (2 c h^2 \left (4 a^2 h^2 (4 f g-e h)-2 a b h \left (-d h^2-e g h+15 f g^2\right )+b^2 \left (d g h^2+15 f g^3\right )\right )-b h^3 \left (8 a^2 f h^2-2 a b h (e h+6 f g)+b^2 \left (d h^2+e g h+5 f g^2\right )\right )-8 c^2 g h \left (a d h^3-5 a f g^2 h+5 b f g^3\right )+16 c^3 f g^5\right )}{16 h^4 \left (a h^2-b g h+c g^2\right )^{5/2}}-\frac{\left (a+b x+c x^2\right )^{3/2} \left (f g^2-h (e g-d h)\right )}{3 h (g+h x)^3 \left (a h^2-b g h+c g^2\right )}+\frac{\sqrt{c} f \tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+b x+c x^2}}\right )}{h^4} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1650
Rule 810
Rule 843
Rule 621
Rule 206
Rule 724
Rubi steps
\begin{align*} \int \frac{\sqrt{a+b x+c x^2} \left (d+e x+f x^2\right )}{(g+h x)^4} \, dx &=-\frac{\left (f g^2-h (e g-d h)\right ) \left (a+b x+c x^2\right )^{3/2}}{3 h \left (c g^2-b g h+a h^2\right ) (g+h x)^3}-\frac{\int \frac{\left (-\frac{3}{2} \left (2 c d g-b e g-2 a f g+\frac{b f g^2}{h}-b d h+2 a e h\right )+3 f \left (b g-\frac{c g^2}{h}-a h\right ) x\right ) \sqrt{a+b x+c x^2}}{(g+h x)^3} \, dx}{3 \left (c g^2-b g h+a h^2\right )}\\ &=-\frac{\left (\frac{8 c^2 f g^5}{h}+4 a^2 e h^4+4 a c g h \left (3 f g^2+d h^2\right )+b^2 g h \left (5 f g^2+h (e g+d h)\right )-2 b \left (a h^2 \left (3 f g^2+2 e g h+d h^2\right )+c \left (7 f g^4+d g^2 h^2\right )\right )+h \left (8 a^2 f h^3+4 a c g h (6 f g-e h)+c^2 \left (\frac{12 f g^4}{h}-4 d g^2 h\right )+b^2 h \left (11 f g^2-h (e g+d h)\right )-2 b \left (12 c f g^3-c g h (e g+2 d h)+a h^2 (10 f g-e h)\right )\right ) x\right ) \sqrt{a+b x+c x^2}}{8 h^2 \left (c g^2-b g h+a h^2\right )^2 (g+h x)^2}-\frac{\left (f g^2-h (e g-d h)\right ) \left (a+b x+c x^2\right )^{3/2}}{3 h \left (c g^2-b g h+a h^2\right ) (g+h x)^3}+\frac{\int \frac{\frac{3 \left (b^3 h^2 \left (5 f g^2+h (e g+d h)\right )+4 b \left (2 c^2 f g^4+2 a^2 f h^4+a c h^2 \left (7 f g^2-e g h-d h^2\right )\right )-8 a c h \left (a h^2 (2 f g-e h)+c \left (f g^3-d g h^2\right )\right )-2 b^2 \left (a h^3 (6 f g+e h)+c \left (7 f g^3 h+d g h^3\right )\right )\right )}{4 h}+\frac{12 c f \left (c g^2-b g h+a h^2\right )^2 x}{h}}{(g+h x) \sqrt{a+b x+c x^2}} \, dx}{12 h^2 \left (c g^2-b g h+a h^2\right )^2}\\ &=-\frac{\left (\frac{8 c^2 f g^5}{h}+4 a^2 e h^4+4 a c g h \left (3 f g^2+d h^2\right )+b^2 g h \left (5 f g^2+h (e g+d h)\right )-2 b \left (a h^2 \left (3 f g^2+2 e g h+d h^2\right )+c \left (7 f g^4+d g^2 h^2\right )\right )+h \left (8 a^2 f h^3+4 a c g h (6 f g-e h)+c^2 \left (\frac{12 f g^4}{h}-4 d g^2 h\right )+b^2 h \left (11 f g^2-h (e g+d h)\right )-2 b \left (12 c f g^3-c g h (e g+2 d h)+a h^2 (10 f g-e h)\right )\right ) x\right ) \sqrt{a+b x+c x^2}}{8 h^2 \left (c g^2-b g h+a h^2\right )^2 (g+h x)^2}-\frac{\left (f g^2-h (e g-d h)\right ) \left (a+b x+c x^2\right )^{3/2}}{3 h \left (c g^2-b g h+a h^2\right ) (g+h x)^3}+\frac{(c f) \int \frac{1}{\sqrt{a+b x+c x^2}} \, dx}{h^4}-\frac{\left (16 c^3 f g^5-8 c^2 g h \left (5 b f g^3-5 a f g^2 h+a d h^3\right )-b h^3 \left (8 a^2 f h^2-2 a b h (6 f g+e h)+b^2 \left (5 f g^2+e g h+d h^2\right )\right )+2 c h^2 \left (4 a^2 h^2 (4 f g-e h)-2 a b h \left (15 f g^2-e g h-d h^2\right )+b^2 \left (15 f g^3+d g h^2\right )\right )\right ) \int \frac{1}{(g+h x) \sqrt{a+b x+c x^2}} \, dx}{16 h^4 \left (c g^2-b g h+a h^2\right )^2}\\ &=-\frac{\left (\frac{8 c^2 f g^5}{h}+4 a^2 e h^4+4 a c g h \left (3 f g^2+d h^2\right )+b^2 g h \left (5 f g^2+h (e g+d h)\right )-2 b \left (a h^2 \left (3 f g^2+2 e g h+d h^2\right )+c \left (7 f g^4+d g^2 h^2\right )\right )+h \left (8 a^2 f h^3+4 a c g h (6 f g-e h)+c^2 \left (\frac{12 f g^4}{h}-4 d g^2 h\right )+b^2 h \left (11 f g^2-h (e g+d h)\right )-2 b \left (12 c f g^3-c g h (e g+2 d h)+a h^2 (10 f g-e h)\right )\right ) x\right ) \sqrt{a+b x+c x^2}}{8 h^2 \left (c g^2-b g h+a h^2\right )^2 (g+h x)^2}-\frac{\left (f g^2-h (e g-d h)\right ) \left (a+b x+c x^2\right )^{3/2}}{3 h \left (c g^2-b g h+a h^2\right ) (g+h x)^3}+\frac{(2 c f) \operatorname{Subst}\left (\int \frac{1}{4 c-x^2} \, dx,x,\frac{b+2 c x}{\sqrt{a+b x+c x^2}}\right )}{h^4}+\frac{\left (16 c^3 f g^5-8 c^2 g h \left (5 b f g^3-5 a f g^2 h+a d h^3\right )-b h^3 \left (8 a^2 f h^2-2 a b h (6 f g+e h)+b^2 \left (5 f g^2+e g h+d h^2\right )\right )+2 c h^2 \left (4 a^2 h^2 (4 f g-e h)-2 a b h \left (15 f g^2-e g h-d h^2\right )+b^2 \left (15 f g^3+d g h^2\right )\right )\right ) \operatorname{Subst}\left (\int \frac{1}{4 c g^2-4 b g h+4 a h^2-x^2} \, dx,x,\frac{-b g+2 a h-(2 c g-b h) x}{\sqrt{a+b x+c x^2}}\right )}{8 h^4 \left (c g^2-b g h+a h^2\right )^2}\\ &=-\frac{\left (\frac{8 c^2 f g^5}{h}+4 a^2 e h^4+4 a c g h \left (3 f g^2+d h^2\right )+b^2 g h \left (5 f g^2+h (e g+d h)\right )-2 b \left (a h^2 \left (3 f g^2+2 e g h+d h^2\right )+c \left (7 f g^4+d g^2 h^2\right )\right )+h \left (8 a^2 f h^3+4 a c g h (6 f g-e h)+c^2 \left (\frac{12 f g^4}{h}-4 d g^2 h\right )+b^2 h \left (11 f g^2-h (e g+d h)\right )-2 b \left (12 c f g^3-c g h (e g+2 d h)+a h^2 (10 f g-e h)\right )\right ) x\right ) \sqrt{a+b x+c x^2}}{8 h^2 \left (c g^2-b g h+a h^2\right )^2 (g+h x)^2}-\frac{\left (f g^2-h (e g-d h)\right ) \left (a+b x+c x^2\right )^{3/2}}{3 h \left (c g^2-b g h+a h^2\right ) (g+h x)^3}+\frac{\sqrt{c} f \tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+b x+c x^2}}\right )}{h^4}-\frac{\left (16 c^3 f g^5-8 c^2 g h \left (5 b f g^3-5 a f g^2 h+a d h^3\right )-b h^3 \left (8 a^2 f h^2-2 a b h (6 f g+e h)+b^2 \left (5 f g^2+e g h+d h^2\right )\right )+2 c h^2 \left (4 a^2 h^2 (4 f g-e h)-2 a b h \left (15 f g^2-e g h-d h^2\right )+b^2 \left (15 f g^3+d g h^2\right )\right )\right ) \tanh ^{-1}\left (\frac{b g-2 a h+(2 c g-b h) x}{2 \sqrt{c g^2-b g h+a h^2} \sqrt{a+b x+c x^2}}\right )}{16 h^4 \left (c g^2-b g h+a h^2\right )^{5/2}}\\ \end{align*}
Mathematica [A] time = 2.28668, size = 439, normalized size = 0.73 \[ \frac{\frac{\left (\frac{\left (b^2-4 a c\right ) \tanh ^{-1}\left (\frac{2 a h-b g+b h x-2 c g x}{2 \sqrt{a+x (b+c x)} \sqrt{h (a h-b g)+c g^2}}\right )}{8 \left (h (a h-b g)+c g^2\right )^{3/2}}+\frac{\sqrt{a+x (b+c x)} (-2 a h+b (g-h x)+2 c g x)}{4 (g+h x)^2 \left (h (a h-b g)+c g^2\right )}\right ) \left (2 a h^2 (e h-2 f g)-b h \left (h (d h+e g)-3 f g^2\right )+c \left (2 d g h^2-2 f g^3\right )\right )}{2 \left (h (a h-b g)+c g^2\right )}-\frac{h (a+x (b+c x))^{3/2} \left (h (d h-e g)+f g^2\right )}{3 (g+h x)^3 \left (h (a h-b g)+c g^2\right )}+\frac{f \left (\frac{(2 c g-b h) \tanh ^{-1}\left (\frac{2 a h-b g+b h x-2 c g x}{2 \sqrt{a+x (b+c x)} \sqrt{h (a h-b g)+c g^2}}\right )}{2 \sqrt{h (a h-b g)+c g^2}}-\frac{h \sqrt{a+x (b+c x)}}{g+h x}+\sqrt{c} \tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+x (b+c x)}}\right )\right )}{h^2}}{h^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.3, size = 19321, normalized size = 32. \begin{align*} \text{output too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\sqrt{a + b x + c x^{2}} \left (d + e x + f x^{2}\right )}{\left (g + h x\right )^{4}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: TypeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]